package com.ch;

import com.ch.service.BuyGoodsService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author chenhong
 * @version 1.0.0
 * @ClassName testButGoodsService.java
 * @Description TODO
 * @createTime 2020年12月13日 19:56:00
 */
public class testButGoodsService {

    @Test
    public void testBuy(){
        String config = "applicationContext.xml";
        ApplicationContext ac = new ClassPathXmlApplicationContext(config);

        BuyGoodsService buyGoodsService = (BuyGoodsService) ac.getBean("buyGoodsService");
        System.out.println(buyGoodsService.getClass().getName());
        buyGoodsService.buyGoods(1002,2);
    }
}
